use NLKHCNData
go

alter table ChuyenGia
add Ten nvarchar(50)
go

update ChuyenGia
set Ten = CASE 
		WHEN CHARINDEX(' ', HoTen) > 0 THEN REVERSE(SUBSTRING(REVERSE(HoTen), 1, CHARINDEX(' ', REVERSE(HoTen)) - 1))
		ELSE HoTen
	END
go